import http from "@/utils/request";

declare global{
    interface productParam{
        product_id?:string,
        category_id?:string,
        categoryImgurl?:string
    }
}

// 获取商品信息
export let getProductList=()=>http.get('/product/get_product')

// 获取商品类目
export let getProductgetCategory=()=>http.get('/category/getCategory')

// 增加类目
export const addCategory = (categoryName:productParam, categoryImgurl:productParam) => http.post('/category/addCategory', {
    categoryName,
    categoryImgurl
})

// 删除类目
export let delCategory = (category_id: string) => http.get('/category/delCategory', {
    params: {
        category_id,
    }
})